//
//  YHYDesignerPTableViewCell.m
//  Home
//
//  Created by 杨泓晔 on 16/4/19.
//  Copyright © 2016年 LanJue. All rights reserved.
//

#import "YHYDesignerPTableViewCell.h"

@interface YHYDesignerPTableViewCell ()
//@property(nonatomic,retain) UILabel *WXlabel;
@property (nonatomic, strong) UIImageView *headImageV;
@property (nonatomic, strong) UIImageView *NYimage;
@property (nonatomic, strong) UIImageView *NVYimage;

@property (nonatomic,retain)UILabel *addL;

@end
@implementation YHYDesignerPTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    
    return self;
}
- (void)createSubView {
    
    //名字
    self.xmLabel = [[UILabel alloc]init];
    //self.xmLabel.textColor = HS;
    self.xmLabel.textColor = LINE;
    self.xmLabel.font = [UIFont fontWithName:TFont size:TEXTCONTENTFONT2 * AUTO_WIDTH];
    
    [self.contentView addSubview:_xmLabel];
    [self.xmLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.equalTo(self.contentView);
        make.left.mas_equalTo(15.00 * AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(6*18.00*AUTO_WIDTH, 25.00*AUTO_WIDTH));
    }];
    
    [self createTypeOneView];
    
}

- (void)creatTime{
    _timeFirstL = [UILabel new];
    [self.contentView addSubview:_timeFirstL];
    [_timeFirstL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerYWithinMargins.mas_equalTo(self.contentView);
        make.centerXWithinMargins.mas_equalTo(self.contentView).offset(-40 * AUTO_WIDTH);
        make.width.mas_equalTo(60 * AUTO_WIDTH);
        make.height.mas_equalTo(15 * AUTO_HEIGHT);
    }];
    self.timeFirstL.textColor = LINE;
    _timeSceondL.font = [UIFont fontWithName:TFont size:TEXTALITTLEFONT * AUTO_WIDTH];
    _timeFirstL.backgroundColor = [UIColor redColor];
    
    
    
    UIImageView *firstSanjiao = [UIImageView new];
    [self.contentView addSubview:firstSanjiao];
    [firstSanjiao mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerYWithinMargins.mas_equalTo(self.contentView);
        make.centerXWithinMargins.mas_equalTo(self.contentView);
        make.width.mas_equalTo(15 * AUTO_WIDTH);
        make.height.mas_equalTo(10 * AUTO_HEIGHT);
        
    }];
    firstSanjiao.image = [UIImage imageNamed:@"jiantt"];
    
    //至
    UILabel *zhiL = [UILabel new];
    [self.contentView addSubview:zhiL];
    [zhiL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(firstSanjiao);
        make.left.mas_equalTo(firstSanjiao.mas_right).offset(3 * AUTO_WIDTH);
        make.width.mas_equalTo(15 * AUTO_WIDTH);
        make.height.mas_equalTo(10 * AUTO_HEIGHT);
        
    }];
    zhiL.font = [UIFont fontWithName:TFont size:TEXTLABELFONT * AUTO_WIDTH];
    zhiL.textColor = LINE;

    zhiL.text = @"至";
    
    
    
//    UIImageView *secondImageView = [UIImageView new];
//    [self.contentView addSubview:secondImageView];
    
//    
//    //止
    UILabel *zhiTwo = [UILabel new];
    [self.contentView addSubview:zhiTwo];
    [zhiTwo mas_makeConstraints:^(MASConstraintMaker *make) {
        
//        make.top.mas_equalTo(zhiTwo.mas_top);
//        make.right.mas_equalTo(zhiTwo.mas_left).offset(10 * AUTO_WIDTH);
//        make.width.mas_equalTo(15 * AUTO_WIDTH);
//        make.height.mas_equalTo(10 * AUTO_HEIGHT);
        
        make.centerY.equalTo(self.contentView);
        make.right.mas_equalTo(-21.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(15.00*AUTO_WIDTH, 15.00*AUTO_WIDTH));

    
        
        
    }];
    zhiTwo.textColor = LINE;
    zhiTwo.text = @"止";
    zhiTwo.font = [UIFont fontWithName:TFont size:TEXTLABELFONT * AUTO_WIDTH];
    
//
    
    UIImageView *secondIV = [UIImageView new];
    [self.contentView addSubview:secondIV];
    [secondIV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(firstSanjiao);
        make.width.height.mas_equalTo(firstSanjiao);
        make.left.mas_equalTo(zhiTwo.mas_left).offset(-15 * AUTO_WIDTH);
        
    }];
    secondIV.image = [UIImage imageNamed:@"jiantt"];
    _myimageView.alpha = 0;
    
    
    

//
    
    
    
    
    _timeSceondL = [UILabel new];
    [self.contentView addSubview:_timeSceondL];
    [_timeSceondL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(zhiL.mas_top);
        make.right.mas_equalTo(_myimageView.mas_left).offset(-3 * AUTO_WIDTH);
        make.width.mas_equalTo(60 * AUTO_WIDTH);
        make.height.mas_equalTo(13 * AUTO_HEIGHT);
        
    }];
    _timeSceondL.font = [UIFont fontWithName:TFont size:TEXTALITTLEFONT * AUTO_WIDTH];
    _timeSceondL.textColor = LINE;
    _timeSceondL.text = @"俄武器的";
    
    
}

- (void)setNum:(NSInteger)num{
    if (num == 1) {
        [self creatTime];
    }
}

//- (void)setType:(NSInteger)type {
//    
//    if (_type != type) {
//        _type = type;
//        if (_type == 1) {
//            [self createTypeOneView];
//        }
//        else if (_type == 2) {
//            [self createheaderView];
//        } else {
//            [self createSexView];
//        }
//    }
//}



- (void)createTypeOneView {
    
    //绿色图片
    _myimageView = [[UIImageView alloc]initWithFrame:CGRectMake(310.00*AUTO_WIDTH, 15.00*AUTO_WIDTH, 40.00*AUTO_WIDTH, 40.00*AUTO_WIDTH)];
    _myimageView.image = [UIImage imageNamed:@"jiantou"];
    [self.contentView addSubview:_myimageView];
    [_myimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.equalTo(self.contentView);
        make.right.mas_equalTo(-21.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(18.00*AUTO_WIDTH, 18.00*AUTO_WIDTH));
        
    }];
    
    //选填
    self.WXlabel = [[UILabel alloc]initWithFrame:CGRectMake(100.00*AUTO_WIDTH, 23.00/AUTO_WIDTH, 100.00*AUTO_WIDTH, 10.00/AUTO_WIDTH)];
    self.WXlabel.font = [UIFont fontWithName:@"Arial" size:TEXTCONTENTFONT2*TEXTWEIGHT];
    self.WXlabel.text = _content;
    self.WXlabel.textColor = TextLightGrayColor;
    self.WXlabel.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.WXlabel];
    [self.WXlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.equalTo(self.contentView);
        make.right.equalTo(_myimageView.mas_left).offset(-6.00*AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(200.00*AUTO_WIDTH, 18.00*AUTO_WIDTH));
        
    }];
}

- (void)setMyimageView:(UIImageView *)myimageView{
    _myimageView = myimageView;
}
//- (void)setType:(NSInteger)type{
//    if (_type != type) {
//        _type = type;
//        if (_type == 1) {
//            [self creataddView];
//        }
//    }
//}
//

- (void)creataddView{
    self.addL = [UILabel new];
    self.addL.backgroundColor = [UIColor redColor];
    self.addL.text = @"dsadas";
    [self.contentView addSubview:self.addL];
    [self.addL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerXWithinMargins.mas_equalTo(self.contentView);
        make.centerYWithinMargins.mas_equalTo(self.contentView);
        
        
    }];
}
-(void)setingModel:(ResignModel *)model{

//    self.WXlabel.text = model.schoolname;
    
    
    
    
    


}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
